package com.financing.wap.dao.impl;


import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;
import com.financing.wap.dto.FpClientActivityDTO;
import com.financing.wap.dao.IFpClientActivityDao;
import com.financing.wap.common.SqlName;
/**
 * fp_client_activity  
 * 客户的活动表 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpClientActivityDao")
public class FpClientActivityDaoImpl extends BaseDaoImpl<FpClientActivityDTO, java.lang.Integer> implements IFpClientActivityDao {


	@Override
	public int insert(FpClientActivityDTO fpClientActivity) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.insert(SqlName.FpClientActivitySql.insert, fpClientActivity);
	}

	@Override
	public void update(FpClientActivityDTO fpClientActivity) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.FpClientActivitySql.update, fpClientActivity);
	}

	@Override
	public void updateForce(FpClientActivityDTO fpClientActivity) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.FpClientActivitySql.updateForce, fpClientActivity);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClientTemplate.delete(SqlName.FpClientActivitySql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<FpClientActivityDTO> queryList(FpClientActivityDTO fpClientActivity) throws SQLException {
		return this.sqlMapClientTemplate.queryForList(SqlName.FpClientActivitySql.queryList, fpClientActivity);
	}

	@Override
	public int queryListCount(FpClientActivityDTO fpClientActivity) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.queryForObject(SqlName.FpClientActivitySql.queryListCount, fpClientActivity);
	}

	@Override
	public FpClientActivityDTO loadById(Integer id) throws SQLException {
		return  (FpClientActivityDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.FpClientActivitySql.loadById,id);
	}

	@Override
	public Class<FpClientActivityDTO> getEntityClass() {
		return FpClientActivityDTO.class;
	}
 	
}
